package com.xcity.game.map;

import com.alibaba.fastjson.annotation.JSONField;
import com.xcity.db.entity.Player;

import naga.x.game.GameUnit;

public class Locatable implements GameUnit {

	@JSONField(name = "roleId")
	protected long id;
	@JSONField(name = "roleName")
	protected String name;
	@JSONField(name = "img")
	protected String icon;
	@JSONField(name = "lv")
	protected int level;
	protected byte sex;
	@JSONField(serialize = false)
	protected int map;
	protected int x;
	protected int y;
	
	public Locatable() {}
	
	public Locatable(Player player) {
		this.id = player.getId();
		this.name = player.getName();
		this.icon = player.getIcon();
		this.level = player.getLevel();
		this.sex = player.getSex();
		this.map = player.getMap();
		this.x = player.getX();
		this.y = player.getY();
	}

	@Override
	public long getId() {
		return id;
	}

	@Override
	public void setId(long id) {
		this.id = id;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String getIcon() {
		return icon;
	}

	@Override
	public void setIcon(String icon) {
		this.icon = icon;
	}

	@Override
	public int getLevel() {
		return level;
	}

	@Override
	public void setLevel(int level) {
		this.level = level;
	}

	public byte getSex() {
		return sex;
	}

	public void setSex(byte sex) {
		this.sex = sex;
	}

	public int getMap() {
		return map;
	}

	public void setMap(int map) {
		this.map = map;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}
	
	
}
